import request from '@/utils/request'

// 创建话题
export function createTopic(data) {
    return request({
        url: '/app/topic/create',
        method: 'post',
        data: data
    })
}

// 更新话题
export function updateTopic(data) {
    return request({
        url: '/app/topic/update',
        method: 'put',
        data: data
    })
}

// 删除话题
export function deleteTopic(id) {
    return request({
        url: '/app/topic/delete?id=' + id,
        method: 'delete'
    })
}

// 获得话题
export function getTopic(id) {
    return request({
        url: '/app/topic/get?id=' + id,
        method: 'get'
    })
}

// 获得话题分页
export function getTopicPage(params) {
    return request({
        url: '/app/topic/page',
        method: 'post',
        data:params
    })
}
// 导出话题 Excel
export function exportTopicExcel(params) {
    return request({
        url: '/app/topic/export-excel',
        method: 'get',
        params,
        responseType: 'blob'
    })
}
